<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>bode</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 28/06/2004</div>
    <p>
      <b>bode</b> - Bode plot</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>bode(sl,[fmin,fmax] [,step] [,comments]
    )</tt>
      </dd>
      <dd>
        <tt>bode(sl,frq [,comments] )</tt>
      </dd>
      <dd>
        <tt>bode(frq,db,phi
    [,comments])</tt>
      </dd>
      <dd>
        <tt>bode(frq, repf [,comments])</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>sl</b>
        </tt>: <tt>
          <b>syslin</b>
        </tt> list (SISO or SIMO linear system) in
          continuous or discrete time.</li>
      <li>
        <tt>
          <b>fmin,fmax</b>
        </tt>: real (frequency bounds (in Hz))</li>
      <li>
        <tt>
          <b>step</b>
        </tt>: real (logarithmic step.)</li>
      <li>
        <tt>
          <b>comments</b>
        </tt>: vector of character strings (captions).</li>
      <li>
        <tt>
          <b>frq</b>
        </tt>: row vector or matrix (frequencies (in Hz) ) (one row for each
          SISO subsystem).</li>
      <li>
        <tt>
          <b>db</b>
        </tt>: row vector or matrix ( magnitudes (in Db)). (one row for each
          SISO subsystem).</li>
      <li>
        <tt>
          <b>phi</b>
        </tt>: row vector or matrix ( phases (in degree)) (one row for each
          SISO subsystem).</li>
      <li>
        <tt>
          <b>repf</b>
        </tt>: row vector or matrix of complex numbers (complex frequency
          response).</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Bode plot, i.e magnitude and phase of the frequency response of
    <tt>
        <b>sl</b>
      </tt>.</p>
    <p>
      <tt>
        <b>sl</b>
      </tt> can be a continuous-time or discrete-time SIMO system
    (see <tt>
        <b>syslin</b>
      </tt>). In case of multi-output the outputs are plotted
    with different symbols.</p>
    <p>The frequencies are given by the bounds <tt>
        <b>fmin,fmax</b>
      </tt> (in Hz)
    or by a row-vector (or a matrix for multi-output) <tt>
        <b>frq</b>
      </tt>.</p>
    <p>
      <tt>
        <b>step</b>
      </tt> is the ( logarithmic ) discretization step. (see
    <tt>
        <b>calfrq</b>
      </tt> for the choice of default value).</p>
    <p>
      <tt>
        <b>comments</b>
      </tt> is a vector of character strings (captions).</p>
    <p>
      <tt>
        <b>db,phi</b>
      </tt> are the matrices of modulus (in Db) and phases (in
    degrees). (One row for each response).</p>
    <p>
      <tt>
        <b>repf</b>
      </tt> matrix of complex numbers. One row for each
    response.</p>
    <p>Default values for <tt>
        <b>fmin</b>
      </tt> and <tt>
        <b>fmax</b>
      </tt> are
    <tt>
        <b>1.d-3</b>
      </tt>, <tt>
        <b>1.d+3</b>
      </tt> if <tt>
        <b>sl</b>
      </tt> is
    continuous-time or <tt>
        <b>1.d-3</b>
      </tt>, <tt>
        <b>0.5</b>
      </tt> if <tt>
        <b>sl</b>
      </tt>
    is discrete-time. Automatic discretization of frequencies is made by
    <tt>
        <b>calfrq</b>
      </tt>.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

s=poly(0,'s')
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
title='(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)';
bode(h,0.01,100,title);
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
clf()
bode([h1;h],0.01,100,['h1';'h'])
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="black.htm">
        <tt>
          <b>black</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="nyquist.htm">
        <tt>
          <b>nyquist</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="gainplot.htm">
        <tt>
          <b>gainplot</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../control/repfreq.htm">
        <tt>
          <b>repfreq</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../control/g_margin.htm">
        <tt>
          <b>g_margin</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../control/p_margin.htm">
        <tt>
          <b>p_margin</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../control/calfrq.htm">
        <tt>
          <b>calfrq</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../control/phasemag.htm">
        <tt>
          <b>phasemag</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
